package com.example.appandroid;

import android.support.v7.app.ActionBarActivity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;


public class MainActivity extends Activity{

    protected void onCreateView(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main); 
        final EditText userName;
		final EditText passWord;
		Button buttonLogin;
		Button buttonCancel;
		
        userName = (EditText)findViewById(R.id.userName);
        passWord = (EditText)findViewById(R.id.password);
        buttonLogin = (Button)findViewById(R.id.login);
        buttonCancel = (Button)findViewById(R.id.buttonCancel);
        
        buttonLogin.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				String name = userName.getText().toString();
				String pass = passWord.getText().toString();
				if(name.equals("chanhthi")&& pass.equals("123")){
					Intent i= new Intent(MainActivity.this,MainScreenActivity.class);
					startActivity(i);
				}
			}
		});
        //buttonCancel.setOnClickListener(this);
        
    }
}
